<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>创业者服务首页</title>
		<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css"/>
		<link rel="stylesheet" type="text/css" href="../css/style.css"/>
		<link rel="stylesheet" href="../css/leftSidebar.css">
	</head>
	<style type="text/css">
	html,body{height: 100%;padding-bottom: 50px;}
		.col-xs-12.nav_right{padding: 0;height: 100px;padding-right: 0;margin-right: 0;min-width: 1100px;height: 100px;padding-right: 0;margin-right: 0;padding-left: 160px;}
		#myTab a{color: #7c7c7c; font-size: 15px;}
		#myTab>li.active>a{color: #3f4142; background-color: #fff;}
		.navbar-form{margin-top: 0;}
		.tab_creat .active{color:#6bc50d;}
		.table>tbody>tr.active>td, .table>tbody>tr.active>th, .table>tbody>tr>td.active, .table>tbody>tr>th.active, .table>tfoot>tr.active>td, .table>tfoot>tr.active>th, .table>tfoot>tr>td.active, .table>tfoot>tr>th.active, .table>thead>tr.active>td, .table>thead>tr.active>th, .table>thead>tr>td.active, .table>thead>tr>th.active{background-color: #fff;}
		.table>tfoot>tr.active>td{background-color: #fff;}
		.table>tbody>tr>td{border-top:0;}
		.table{margin-bottom: 0;}
		div.tab_creat.row{background-color: #fff;}
		.tab_font{padding: 10px 0;}
		.tab_font div,.tab_font td{font-size: 14px; color: #919191;}
		.gongsi_list div.col-xs-2{padding-top:10px;padding-bottom: 10px;text-align: center;}
		.gongsi_list.row{padding: 20px;background-color: #fff;margin-top: 20px;border: 1px solid #ddd;}
		.gongsi_list dd div.col-xs-2{height: 60px;line-height: 60px;font-size: 14px; color: #4f5051;}
		.row{margin: 0;	}
		
		.sub_logo{position: relative;display: inline-block;padding-left: 0;}
		.sub_logo input{opacity: 0;position: absolute;width: 100%;top: 0;bottom: 0;}
		.zhube_head{border-bottom: 1px solid #ddd;}
		.zhube_head h3{padding: 5px 0;, color: #222c38;font-size: 16px;border-bottom: 4px solid #5a626d;}
			
		#form_test1 label,#form_test2 label{font-size: 14px; color: #515151;font-weight: normal;}
		#form_test1  .media-middle,#form_test2  .media-middle{font-size: 14px;color: #acacac;}
		.form_tip{font-size: 12px;color: #acacac; }
		.btn-default{border-color: #d5272d;color: #d5272d;}
		.btn-default.disabled{background-color: #ccc;color: #fff;border-color:#ccc;}
		.btn-default.disabled.focus, .btn-default.disabled:focus, .btn-default.disabled:hover, .btn-default[disabled].focus, .btn-default[disabled]:focus, .btn-default[disabled]:hover, fieldset[disabled] .btn-default.focus, fieldset[disabled] .btn-default:focus, fieldset[disabled] .btn-default:hover{background-color: #ccc;color: #fff;}
		.btn_next{width: 180px;}
		.btn_next,.btn_back{margin-bottom: 50px;}
		
		.form-group .xiangmuInfo{color: #f00;}
		#area_out label:nth-child(1){margin-left: 10px;}

	</style>
	<body style="background-color: #f2f2f2;">
		<div class="row warp" style="height: 100%;">
			<div class="nav_right_head">
				<a href="../index.html"><img src="../img/roleIndexBg.jpg"/></a>
			</div>
			<!--左侧导航-->
			<div class="col-xs-2 nav_left">
				<div class="creatNav">技术需求服务</div>
				<div class="creatLoginStatus"><img src="../img/avtar.png"><a>您好，技术需求者</a></div>
				<div class="list-group" style="padding: 0;">
					<a href="xqfb_index.html" class="list-group-item "><i class="glyphicon glyphicon-home"></i> 首页</a>
					<a href="xqfb_fbdxq.html" class="list-group-item active"><i class="glyphicon glyphicon-cd"></i> 发布的需求</a>
					<a href="xqfb_jsdd.html" class="list-group-item"><i class="glyphicon glyphicon-list-alt"></i> 接收的订单</a>
					<a href="xqfb_fbcg.html" class="list-group-item"><i class="glyphicon glyphicon-export"></i> 发布的成果</a>
					<a href="xqfb_gmcg.html" class="list-group-item " ><i class="glyphicon glyphicon-shopping-cart"></i> 购买的成果</a>
					<a href="xqfb_mynews.html" class="list-group-item"><i class="glyphicon glyphicon-book"></i> 我的消息</a>

				</div>
				<div class="backBtn"> <a href="../index.html"><img src="../img/backIndex.png"></a></div>
			</div>
			
			<div class="col-xs-12 nav_right">

				
				
			
					<div class="row" style="margin-top: 10px;">
						<div class="col-xs-8 col-xs-offset-2  zhuche_progress1" >
							<div class="zhube_head clearfix">
								<h3 class="pull-left">基本信息</h3>
							</div>
							<form class="form-horizontal" id="form_test1" style="padding: 20px 0;"> 
							  <div class="form-group">
							    <label for="demandProfile" class="col-sm-3 control-label"><span class="xiangmuInfo">*</span>需求简介</label>
							    <div class="col-sm-8">
							      <input type="text"  name='demandProfile' class="form-control" id="demandProfile" placeholder="请输入需求简介" nullmsg="请输入需求简介！" datatype='*'>
							    </div>
							  </div>
							  <div class="form-group">
							    <label for="price" class="col-sm-3 control-label">悬赏金额</label>
							    <div class="col-sm-8">
							      <input type="text" name="price" class="form-control" id="price" placeholder="请输入悬赏金额！" >
							    </div>
							  </div>
							 
							
							
							 
							 <div class="form-group">
							    <label for="area" class="col-sm-3 control-label"><span class="xiangmuInfo">*</span>地区</label>
							    <div class="col-sm-8">
							     <select class="form-control" id="area" name="area" value="" >
									</select>
							    </div>
							  </div>
							  
							  
							<div class="form-group">
								<div class="row">
									<h5 class="col-xs-3 text-right"><span class="xiangmuInfo">*</span>投资领域</h5>
								</div>
							  	
							<div class="row " style="padding-bottom: 20px;padding-left: 20px;">	
								<div class="col-xs-offset-3 " id="area_out">
									<label class="checkbox-inline col-xs-3 ">
									  <input type="checkbox" name="areas"  value="1">汽车交通
									</label>
									
								</div>
								
							</div>
							
							<input type="hidden" name="field" id="field" datatype='*' nullmsg="请选择所选领域！" value="" />
							  </div>
							 
							  <div class="form-group">
							    <label for="overview" class="col-sm-3 control-label"><span class="xiangmuInfo">*</span>项目概述</label>
							    <div class="col-sm-8">
							      <textarea class="form-control" id="overview" name="overview" datatype='*' nullmsg='请填写项目概述' rows="3" placeholder="可拆分未产品描述、用户群体、项目愿景、竞争对手等方面描述，不超多1000字"></textarea>
							    </div>
							  </div>
					  		<input type="hidden" name="userId" id="userId" value="" />
							  <div class="form_tip">注意：为了保证审核效率，请仔细检查结果中需要添加的</div>
							  <button class="btn btn-default center-block btn_next"  style="">提交</button>
							</form>
							
						</div>

				</div>
					
			
		</div>
		</div>
	</body>
	<script src="../js/jquery-2.1.1.min.js"></script>
	<script type="text/javascript" src="../js/bootstrap.min.js" ></script>
	<script type="text/javascript" src="../js/Validform_v5.3.2_min.js" ></script>
	<script type="text/javascript" src="../js/public.js"></script>
	<script type="text/javascript">
	
	var person = JSON.parse(sessionStorage.getItem("person"));

	if (person==''||person==null) {
		alert('请先登录')
		 window.location.href='denglu.html';
	} else{
	var userId = person.userid;
	console.log(userId)
	$('#userId').val(userId)
	
	}
	

	$("#form_test1").Validform({
			btnSubmit:".btn_next",
			tiptype:1,
		beforeCheck:function(){
		var domains = '';
			 $('input[name="areas"]:checked').each(function(){    
			   domains+=$(this).val()+','
			  });  
			domains=domains.substring(0,domains.length-1);
			  console.log(domains);
			  $('#field').val(domains)	
		},
		beforeSubmit:function(curform){
			
			doUpload();
			return false;
		}
	});
	
	
	function doUpload() {  
	     var formData = new FormData($( "#form_test1" )[0]);  
	     $.ajax({  
	          url: 'http://114.112.96.184:18080/demand/issue' ,
	          type: 'POST',  
	          data: formData,  
	          async: false,  
	          cache: false,  
	          contentType: false,  
	          processData: false,  
	          success: function (data) {  
	           console.log(data);
	           if (data.code==000) {
	           	window.location.href='xqfb_index.html';
	           } 
	          },  
	          error: function (returndata) {  
	              alert(returndata);  
	          }  
	     });  
		}  
		
		//		领域
			$.ajax({
                type: "get",
                url:"http://114.112.96.184:18080/dict/field",
                error: function(request) {
                    alert("Connection error");
                },
                success: function(data) {
                	console.log(data)
                   var obj = data.result;
                   var htmls='';
                   for (var i = 0; i < obj.length;i++) {
                   	
                   	htmls+= '<label class="checkbox-inline col-xs-3"><input type="checkbox" name="areas"  value="'+ obj[i].id +'">'+obj[i].value+'</label>'
                   }
                   $('#area_out').html(htmls);
                }
            });
            
            //		地区	
	$.ajax({
                type: "get",
                url:"http://114.112.96.184:18080/dict/area",
                async: true,
                error: function(request) {
                    alert("Connection error");
                },
                success: function(data) {
                	console.log(data)
                   var obj = data.result;
                   var htmls='';
                   for (var i = 0; i < obj.length;i++) {
                   	htmls+= "<option value=" + obj[i].id +" >"+ obj[i].value  +"</option>"
                   }
                   $('#area').html(htmls);
                }
            });
	</script>
</html>
